﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraFollow : MonoBehaviour
{
    public GameObject target;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        Transform target_transform = target.GetComponent<Transform>();
        Rigidbody2D target_rb = target.GetComponent<Rigidbody2D>();

        Vector2 place = (Vector2)target_transform.position;// + target_rb.velocity;
        this.GetComponent<Transform>().position = new Vector3(place.x, place.y, GetComponent<Transform>().position.z);
    }
}
